Hi Everybody, |
Re: TRiggers Trouble I have found triggers quite tricky but recently had to do something very similar to your problem. The trigger code is embedded within the module by executing it within the target module. The trigger statement references a separate dxl file which contains the code to update the required attribute. Trigger t = trigger("edited",module->"<Module>"->attribute->"<Attribute_name>",pre,modify,1,"#include <Path to dxl file>") Trigger t = current if ( !null t ) { Object o = object(t) if ( !null o ) { bool amended = true o."<attribute_name>" = <value> } } Hope this helps Mark |
Re: TRiggers Trouble mwilliamson - Wed Jul 22 12:00:57 EDT 2009 I thought smth like this, but my trouble is: where I've to put, to save the following code: Trigger t = trigger("edited",module->"<Module>"->attribute->"<Attribute_name>",pre,modify,1,"#include <Path to dxl file>") when I have the module opened, what are the steps to integrate the comand in the module? I guess that my question is clear! Thank in advance Michele |
Re: TRiggers Trouble mikimichele82 - Wed Jul 22 12:13:27 EDT 2009 So once you have executed suggested lines when save the module the trigger is permanently installed. Quitely read DXL manual and have some tests. |
Re: TRiggers Trouble The '#include' statement is discouraged since it requires everybody who might use that module to have access to the specified server path. That may work for closes DOORS systems but isn't realistic for more open ones. Instead, the deploy code could issue a 'readFile' command using the #include, then deploy in full that code. If you modify the code you must re-deploy the trigger, but the deployed code contains no #include statement making it universally available. The code should check if the module has been open Edit. If this code was to work on many modules you could change it to a project trigger, in which case the code would check the module name (or the existence of the attribute) to see if it really wants to update the attribute.
|